package com.yonder.testunsafe;

import sun.reflect.Reflection;

public class ReflectionTest {

	public static void main(String[] args) {
		CC.test();
	}
	
	public static class CC {
		public static void test() {
			BB.test();
		}
	}
	
	public static class BB {
		public static void test() {
			DD t = new DD();
			t.t();
		}
	}
	
	public static class DD {
		@SuppressWarnings("deprecation")
		public void t() {
			System.out.println(Reflection.getCallerClass(0));//Reflection
			System.out.println(Reflection.getCallerClass(1));//1层调用类
			System.out.println(Reflection.getCallerClass(2));//2层调用类
			System.out.println(Reflection.getCallerClass(3));//3层调用类
			System.out.println(Reflection.getCallerClass(4));//4层调用类
		}
	}
}
